import time
import os
from werkzeug.utils import secure_filename
def file_read(f):
    fileName = secure_filename(f.filename)
    ext = fileName.rsplit('.', 1)[0]  # 获取文件后缀
    unix_time = int(time.time())
    new_filename = str(unix_time) + "." + ext
    upload_path = os.path.curdir + os.path.sep + 'static/' + 'upload/'
    file_url = upload_path + new_filename
    f.save(os.path.join(upload_path, new_filename))
    return file_url